package com.sheeran.aichat.dto.bigmodel;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author: sheeran
 * @create: 2025/02/13
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class BigModelToolsResponseDTO {

    @JsonProperty("choices")
    private List<ChoicesDTO> choices;

    @NoArgsConstructor
    @AllArgsConstructor
    @Data
    public static class ChoicesDTO {
        @JsonProperty("finish_reason")
        private String finishReason;
        @JsonProperty("index")
        private Integer index;
        @JsonProperty("message")
        private MessageDTO message;

        @NoArgsConstructor
        @AllArgsConstructor
        @Data
        public static class MessageDTO {
            @JsonProperty("role")
            private String role;
            @JsonProperty("tool_calls")
            private List<ToolCallsDTO> toolCalls;

            @NoArgsConstructor
            @AllArgsConstructor
            @Data
            public static class ToolCallsDTO {
                @JsonProperty("id")
                private String id;
                @JsonProperty("search_intent")
                private List<SearchIntentDTO> searchIntent;
                @JsonProperty("type")
                private String type;
                @JsonProperty("search_result")
                private List<SearchResultDTO> searchResult;

                @NoArgsConstructor
                @AllArgsConstructor
                @Data
                public static class SearchIntentDTO {
                    @JsonProperty("category")
                    private String category;
                    @JsonProperty("index")
                    private int index;
                    @JsonProperty("intent")
                    private String intent;
                    @JsonProperty("keywords")
                    private String keywords;
                    @JsonProperty("query")
                    private String query;
                }

                @NoArgsConstructor
                @AllArgsConstructor
                @Data
                public static class SearchResultDTO {
                    @JsonProperty("content")
                    private String content;
                    @JsonProperty("icon")
                    private String icon;
                    @JsonProperty("index")
                    private int index;
                    @JsonProperty("link")
                    private String link;
                    @JsonProperty("media")
                    private String media;
                    @JsonProperty("refer")
                    private String refer;
                    @JsonProperty("title")
                    private String title;
                }
            }
        }
    }


}
